﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MailConfig.aspx.cs" Inherits="E.Web.Teacher.Mail.MailConfig" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>定时邮件提醒</title>
    <link rel="stylesheet" href="/css/main.css" type="text/css" media="all" />
    <link rel="stylesheet" href="/css/t_main.css" type="text/css" media="all" />
    <link rel="stylesheet" href="/css/sys.css" type="text/css" media="all" />
    <link rel="stylesheet" href="/css/flora.datepick.css" type="text/css" media="all" />
    <script type="text/javascript" src="/js/ajax.js"></script>
    <script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="/js/jquery.datepick.min.js"></script>
    <script type="text/javascript" src="/js/jquery.datepick-zh-CN.js"></script>
    <script language="javascript" type="text/javascript">
        $(document).ready(
      function () {
          $("#StartTimeTxt").datepick({ dateFormat: 'yy-mm-dd', showOn: 'button', buttonImage: '/images/icon/calendar-green.gif', buttonImageOnly: true });

      }
    );

        function CheckMail() {
            var mailDay = $("#txtMailDay").val();
            var startTime = $("#StartTimeTxt").val();
            var mailName = $("#txtMailName").val();
            var mailPass = $("#txtMailPass").val();
            var mailHost = $("#txtMailHost").val();
            var mailTitle = $("#txtMailTitle").val();
            var mailContent = $("#txtMailContent").val();
            var mailreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
            if (!mailreg.test(mailName)) {
                alert('请输入有效的E_mail！');
                return false;
            }
            if (mailPass == "") {
                alert('请输入邮箱密码！');
                return false;
            }
            if (mailHost == "") {
                alert('请输入SMTP服务器主机名称！');
                return false;
            }
            if (mailDay == "" || isNaN(mailDay)) {
                alert("间隔时间不能为空或只能为数字");
                return false;
            }
            if (startTime == "") {
                alert("请设置开始时间");
                return false;
            }
            if (mailTitle == "") {
                alert("请设置标题");
                return false;
            }
            if (mailContent == "") {
                alert("请设置邮件内容");
                return false;
            }
            return true;
        }
       
    </script>
</head>
<body>
    <form id="form1" method="post" action="?act=u">
    <div class="block" style="height: 100px;">
        <div style="width: 650px; height: 22px;">
            <div class="title">
                &nbsp;定时邮件提醒</div>
        </div>
        <div class="spe_line_2">
        </div>
          <div class="box_1">
            <div class="fl tr left">
               发件人邮箱：</div>
            <div class="fl">
                <input type="text" id="txtMailName" name="txtMailName"  style="width:150px" value="<%=mailName %>" /></div>
        </div>
          <div class="box_1">
            <div class="fl tr left">
               发件人邮箱密码：</div>
            <div class="fl">
                <input type="text" id="txtMailPass" name="txtMailPass"  style="width:150px" value="<%=mailPass %>" /></div>
        </div>
         <div class="box_1">
            <div class="fl tr left">
               SMTP服务器主机名称：</div>
            <div class="fl">
                <input type="text" id="txtMailHost" name="txtMailHost"  style="width:150px" value="<%=mailHost %>" /></div>
        </div>
        <div class="box_1">
            <div class="fl tr left">
               开始时间：</div>
            <div class="fl">
                <input type="text" id="StartTimeTxt" style="width:130px" name="StartTimeTxt" value="<%=mailTime %>" /></div>
        </div>
        <div class="box_1">
              <div class="fl tr left">
               间隔时间：</div>
            <div class="fl">
                 每隔
            <input id="txtMailDay" name="txtMailDay" type="text" value="<%=maiDay %>" />
            天提醒</div>
        </div>
         <div class="box_1">
            <div class="fl tr left">
               标题：</div>
            <div class="fl">
                <input type="text" id="txtMailTitle" name="txtMailTitle"  style="width:150px" value="<%=mailTitle %>" /></div>
        </div>
         <div class="box_1">
            <div class="fl tr left">
               内容：</div>
            <div class="fl">
                <textarea   id="txtMailContent" name="txtMailContent"  style="width:324px" 
                    value="<%=mailContent %>"></textarea>
             
        </div>
        <div class="box_1">
              <div class="fl tr left">
               </div>
            <div class="fl">
             <input type="image" style="width: 54px; height: 23px;" src="/images/btn/confirm2.gif"
                onclick="return CheckMail();" /></div>
        </div>
    </div>
    </form>
</body>
</html>
